#pragma once

#if defined(__linux__) || defined(__APPLE__)
#include <sys/socket.h>
#include <netinet/ip.h>
#include <arpa/inet.h>
#include <unistd.h>

#define uniform_socket_t int
#define uniform_sockaddr sockaddr
#define uniform_socket_init()
#define uniform_socket_cleanup()
#else
#include <WinSock2.h>

#define uniform_socket_t SOCKET
#define uniform_sockaddr SOCKADDR
#define uniform_socket_init()\
	WSADATA wsadata;\
	WSAStartup(MAKEWORD(2, 3), &wsadata)
#define uniform_socket_cleanup() WSACleanup()
#endif

int uniform_socket_close(uniform_socket_t);